# -*- coding:utf-8 -*-
#encoding: utf-8

from exts import db

class dic_field_type(db.Model):
    __tablename__ = 'dic_field_type'
    field_type_id = db.Column(db.INTEGER,primary_key=True,autoincrement=True) #字段类型ID
    field_type_name = db.Column(db.String(100),nullable=False)  #字段类型名称
    interface_group_desc = db.Column(db.TEXT)  # 字段类型描述：描述该组接口作用

    @staticmethod
    def insert_sources():
        sources = (u'int',
                   u'varchar',
                   u'double')
        for s in sources:
            source = Source.query.filter_by(name=s).first()
            if source is None:
                source = Source(name=s)
            db.session.add(source)
        db.session.commit()
